package com.code.AZPlan.model.po;

import com.code.commons.model.po.BasePO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * AZ计划个人收益流水PO及持久层对象
 *
 * @author tangyifei
 * @since 2019年12月31日14:34:55
 */
@ApiModel("AZ计划个人收益流水PO及持久层对象")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class IncomeFlow extends BasePO<String> {

    private static final long serialVersionUID = 8106406662967409390L;

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @Length(min = 1, max = 64)
    private String id;

    @ApiModelProperty(value = "用户主键", example = "1")
    @NotBlank(message = "用户主键不能为空")
    @Length(min = 1, max = 64)
    private String userId;

    @ApiModelProperty(value = "收益日期时间", example = "XXXXXX")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date incomeDateTime;

    @ApiModelProperty(value = "用户账号", example = "1")
    private String userAccount;

    @ApiModelProperty(value = "收益类型 1 本人静态收益  2动态收益中的推荐收益  3动态收益中的团队收益", example = "1")
    private Integer incomeType;

    @ApiModelProperty(value = "收益金额", example = "1000USD")
    @NotNull(message = "收益金额不能为空")
    private BigDecimal incomeAmount;
}
